<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
?>
<script type="text/javascript">
	$(function(){
		$("#back").click(function() {
			if(one.urls.length < 0)
				one.changeContent(one.urls[one.urls.length-2]);
			else{
				url = $.cookie("backAfterSubmit");
				if(url && url != ""){
					one.changeContent(url);
				}else{
					one.changeContent(BASEURL+"cp");
				}
			}
		});
		$("#content").css("background","url("+BASEURL+"files/cp/icons/messages.gif) no-repeat right bottom");
	});
</script>
<?php
if(isset($messages)){
	?><div id="messages" class="message"><table width="100%"><?php
	foreach($messages as $message){
		echo "<tr><td><ul style='padding-right:25px;padding-left:25px;'><li>$message</li></ul></td></tr>";
	}
	if(!isset($errors)){
		?>
		<tr><td align="right"><input style="border:1px green solid;color:green;" type="button" name="back" id="back" value="back"/></td></tr>
		<?php
	}
	?></table></div><?php
}
if(isset($messages) && isset($errors)){
	echo "<br><br>";
}
if(isset($errors)){
	?><div id="errors" class="error"><table width="100%"><?php
	foreach($errors as $error){
		echo "<tr><td><ul style='padding-right:25px;padding-left:25px;'><li>$error</li></ul></td></tr>";
	}
	?><tr><td align="right"><input style="border:1px red solid;color:red;" type="button" name="back" id="back" value="back"/></td></tr></table></div><?php
}
?>